package com.peycard.persistence.entities;

import java.io.Serializable;
import javax.persistence.*;

import java.sql.Timestamp;
import java.math.BigDecimal;
import java.util.Set;


/**
 * The persistent class for the READER_LIST database table.
 * 
 */
@Entity
@Table(name="READER_LIST")
@NamedQueries({
	@NamedQuery(name="findReaderListByNS_1", query="SELECT r FROM ReaderList r where r.serialNumber = :serial_1"),
	@NamedQuery(name="findReaderList_all_1", query="SELECT r FROM ReaderList r"),
	@NamedQuery(name="findReaderList_NV_1", query="SELECT r FROM ReaderList r where r.vinculacions IS EMPTY")
})
public class ReaderList implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="READER_LIST_IDREADERLIST_GENERATOR", sequenceName="ID_READER_LIST_GENERATOR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="READER_LIST_IDREADERLIST_GENERATOR")
	@Column(name="ID_READER_LIST")
	private long idReaderList;

	@Column(name="ENCRYPTION_KEY")
	private String encryptionKey;

	@Column(name="IS_ACTIVE")
	private BigDecimal isActive;

	@Column(name="MESSAGE_SECURITY")
	private BigDecimal messageSecurity;

	@Column(name="SAVE_DATA")
	private Timestamp saveData;

	@Column(name="SERIAL_NUMBER")
	private String serialNumber;

	private String username;

	private String version;

	//bi-directional many-to-one association to Affiliate
	@OneToMany(mappedBy="readerList")
	private Set<Affiliate> affiliates;

	//bi-directional many-to-one association to ReaderControl
    @ManyToOne
	@JoinColumn(name="ID_READER_CONTROL")
	private ReaderControl readerControl;

	//bi-directional many-to-one association to Vinculacion
	@OneToMany(mappedBy="readerList")
	private Set<Vinculacion> vinculacions;

    public ReaderList() {
    }

	public long getIdReaderList() {
		return this.idReaderList;
	}

	public void setIdReaderList(long idReaderList) {
		this.idReaderList = idReaderList;
	}

	public String getEncryptionKey() {
		return this.encryptionKey;
	}

	public void setEncryptionKey(String encryptionKey) {
		this.encryptionKey = encryptionKey;
	}

	public BigDecimal getIsActive() {
		return this.isActive;
	}

	public void setIsActive(BigDecimal isActive) {
		this.isActive = isActive;
	}

	public BigDecimal getMessageSecurity() {
		return this.messageSecurity;
	}

	public void setMessageSecurity(BigDecimal messageSecurity) {
		this.messageSecurity = messageSecurity;
	}

	public Timestamp getSaveData() {
		return this.saveData;
	}

	public void setSaveData(Timestamp saveData) {
		this.saveData = saveData;
	}

	public String getSerialNumber() {
		return this.serialNumber;
	}

	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getVersion() {
		return this.version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public Set<Affiliate> getAffiliates() {
		return this.affiliates;
	}

	public void setAffiliates(Set<Affiliate> affiliates) {
		this.affiliates = affiliates;
	}
	
	public ReaderControl getReaderControl() {
		return this.readerControl;
	}

	public void setReaderControl(ReaderControl readerControl) {
		this.readerControl = readerControl;
	}
	
	public Set<Vinculacion> getVinculacions() {
		return this.vinculacions;
	}

	public void setVinculacions(Set<Vinculacion> vinculacions) {
		this.vinculacions = vinculacions;
	}
	
}